Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

minio

Package Overview
Dependencies
Maintainers
4
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minio

S3 Compatible Cloud Storage client

  • 7.1.4
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created

What is minio?

The MinIO npm package is a client library for interacting with MinIO and Amazon S3 compatible cloud storage services. It allows developers to perform a variety of operations such as uploading, downloading, and managing data in object storage.

What are minio's main functionalities?

Initialize MinIO Client

This code initializes a MinIO client instance with the necessary configuration such as endpoint, port, SSL usage, access key, and secret key.

const Minio = require('minio');

const minioClient = new Minio.Client({
  endPoint: 'play.min.io',
  port: 9000,
  useSSL: true,
  accessKey: 'Q3AM3UQ867SPQQA43P2F',
  secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG'
});

Upload an Object

This code uploads a file from the local filesystem to a specified bucket in the MinIO server.

minioClient.fPutObject('my-bucket', 'my-object', '/path/to/file', function(err, etag) {
  if (err) return console.log(err);
  console.log('File uploaded successfully.');
});

Download an Object

This code downloads an object from a specified bucket in the MinIO server to the local filesystem.

minioClient.fGetObject('my-bucket', 'my-object', '/path/to/destination', function(err) {
  if (err) return console.log(err);
  console.log('File downloaded successfully.');
});

List Objects in a Bucket

This code lists all objects in a specified bucket. It uses a stream to handle the data and errors.

var stream = minioClient.listObjects('my-bucket', '', true);
stream.on('data', function(obj) { console.log(obj); });
stream.on('error', function(err) { console.log(err); });

Remove an Object

This code removes a specified object from a bucket in the MinIO server.

minioClient.removeObject('my-bucket', 'my-object', function(err) {
  if (err) return console.log(err);
  console.log('Object removed successfully.');
});

Other packages similar to minio

Keywords

FAQs

Package last updated on 25 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc